using System;
using UnityEngine;

public class MovableRandomIdle : MonoBehaviour
{
	[Serializable]
	public class EditorReferences
	{
		public RuntimeAnimatorController[] idleAnimations;

		public RuntimeAnimatorController GetRandomAnimation()
		{
			if (idleAnimations == null || idleAnimations.Length == 0)
			{
				return null;
			}
			return idleAnimations[UnityEngine.Random.Range(0, idleAnimations.Length)];
		}
	}

	[SerializeField]
	public EditorReferences references = new EditorReferences();

	private void Start()
	{
		RuntimeAnimatorController randomAnimation = references.GetRandomAnimation();
		if ((bool)randomAnimation)
		{
			MovableAnimation component = GetComponent<MovableAnimation>();
			component.SetAnimation(randomAnimation);
		}
	}
}
